Easy way to solve the merchant problem, have a 'Buyback' tab, to buy back any item you sold to the merchant (from the last 20 you sold) at the same price you sold it for.
There's nothing quite as effective as patience and diligence then. As long as people CAN make mistakes, they WILL make mistakes. You just take whatever precautions you deem necessary to help you avoid them. :\